#!/usr/bin/env python
# -*- coding: utf8 -*-
# title       :
# description :
# author      :'ShenMeng'

from qtpy import QtCore, QtGui
import copy

class ThumbnailItemBase(QtGui.QStandardItem):
    def __init__(self, data):
        super(ThumbnailItemBase, self).__init__()
        self._data = data
        self._thumbnail = None
        self._thumbnail_size = QtCore.QSize(0,0)

    @property
    def code(self):
        return self._data.get('code')

    @property
    def name(self):
        return self._data.get('name')

    @property
    def status(self):
        return self._data.get('status')

    @property
    def thumbnail(self):
        return self._data.get('thumbnail')

    def to_dict(self):
        return copy.deepcopy(self._data)